// pages/apiui/apiui.js
Page({

  /**
   * 页面的初始数据
   */
  data: {

  },
  relauch: function () {
    wx.reLaunch({
      url: '/pages/request/request',

    })
  },

  redirect: function () {
    wx.redirectTo({
      url: '/pages/download/download',
    })
  },
  switchtab: function () {
    wx.switchTab({
      url: '/pages/request/request',
    })
  },

  showtoast: function () {
    wx.showToast({
      title: 'title',
      icon: 'loading',
      image: '/image/timg.jpg',
      mask: true,
      success: function (res) { },
    })
  },
  showloading: function () {
    wx.showLoading({
      title: 'title',
    })
    setTimeout(function () {
      wx.hideLoading()
    }, 2000)
  },
  showmodal: function () {
    wx.showModal({
      title: 'title',
      content: 'content',
      showCancel: true,
      cancelText: '关闭',
      cancelColor: '',
      success: function (res) {
        console.log(res)
      },
    })
  },
  showActionSheet: function () {
    wx.showActionSheet({
      itemList: ["第一条", "第二条"],
      itemColor: '#bbbbbb',
      success: function (res) {
        console.log(res)
      },
    })
  },
  settitle: function () {
    wx.setNavigationBarTitle({
      title: '吴施琦真好看'

    })
    wx.showNavigationBarLoading()
  },
  /**
   * 生命周期函数--监听页面加载
   */
  onLoad: function (options) {
    console.log(options)
    wx.setNavigationBarTitle({
      title: options.title,
    })
    wx.getUserInfo({
      success: function (e) {
        console.log(e)
      }
    })
  },
  enablePullDownRefresh: function () {
    console.log("enablePullDownRefresh")
  },
  startpull: function () {
    wx.startPullDownRefresh({

    })
  },
  stoppull: function () {
    wx.enablePullDownRefresh()
  },
  authorize: function () {
    wx.authorize({
      scope: 'scope.userInfo',
      success: function (res) {
        console.log(res)
      },
    })
  },
  mybindgetuserinfo: function (e) {
    console.log(e.detail.rawData)
  },


  /**
   * 生命周期函数--监听页面初次渲染完成
   */
  onReady: function () {

  },

  /**
   * 生命周期函数--监听页面显示
   */
  onShow: function () {

  },

  /**
   * 生命周期函数--监听页面隐藏
   */
  onHide: function () {

  },

  /**
   * 生命周期函数--监听页面卸载
   */
  onUnload: function () {

  },

  /**
   * 页面相关事件处理函数--监听用户下拉动作
   */
  onPullDownRefresh: function () {

  },

  /**
   * 页面上拉触底事件的处理函数
   */
  onReachBottom: function () {

  },

  /**
   * 用户点击右上角分享
   */
  onShareAppMessage: function () {
    return {
      title: '自主定义转发标题',
      path: '/pages/request/request',
      imageUr1: '/imge/ting.jpg'
    }
  }
})